<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<title>复焕集 - 商品详情</title>
		<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<!-- Font Awesome 图标 -->
    	<link rel="stylesheet" href="fontawesome/css/all.min.css">
		<link rel="stylesheet" href="css/goods-info.css" />
		<!-- 字体文件 -->
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/sign.css" />
		<link rel="stylesheet" href="css/login.css" />
	</head>
	<body>
		<div class="container-fluid logP hidden text-center" id="logP">
			<div class="login-container hidden" id="log">
				<!-- 登录卡片 -->
				<div class="login-card" id="login-card">
					<!-- 头部区域 -->
					<div class="login-header">
						<h1>欢迎回来</h1>
						<p>请登录您的账户</p>
					</div>

					<!-- 表单区域 -->
					<div class="form-container">
						<!-- 头像显示区域 -->
						<div class="avatar-container" id="avatarContainer">
							<div class="avatar-placeholder">
								👤
							</div>
						</div>

						<!-- 响应消息 -->
						<div id="responseMessage" class="response-message"></div>

						<!-- 登录表单 -->
							<!-- 用户名/邮箱 -->
							<div class="form-group">
								<label for="loginId">用户名</label>
								<div class="input-wrapper">
									<div class="input-icon">@</div>
									<input type="text" id="loginId" name="loginId" class="form-control"
										placeholder="请输入用户名" required>
								</div>
							</div>

							<!-- 密码 -->
							<div class="form-group">
								<label for="password">密码</label>
								<div class="input-wrapper">
									<div class="input-icon">🔒</div>
									<input type="password" id="password" name="password" class="form-control"
										placeholder="请输入密码" required>
									<div class="password-toggle" id="togglePassword">👁️</div>
								</div>
								<div style="margin-top: 8px;">
									<span id="loginInfo" class="status-text"></span>
								</div>
								<div class="forgot-password">
									<a href="#">忘记密码?</a>
								</div>
							</div>

							<!-- 记住我 -->
							<div class="remember-me">
								<input type="checkbox" id="rememberMe" name="rememberMe">
								<label for="rememberMe">记住我的登录状态</label>
							</div>

							<!-- 登录按钮 -->
							<button class="login-btn" id="loginBtn">
								<span id="loginBtnText">登录账户</span>
							</button>

					</div>
				</div>
			</div>

			<div class="register-container hidden" id="sig">
				<!-- 注册卡片 -->
				<div class="register-card">
					<!-- 头部区域 -->
					<div class="register-header">
						<h1>用户注册</h1>
						<p>创建您的专属账户</p>
					</div>

					<!-- 表单区域 -->
					<div class="form-container">
						<!-- 响应消息 -->
						<div id="responseMessage" class="response-message"></div>

						<!-- 注册表单 -->
						<form id="registerForm">
							<!-- 用户名 -->
							<div class="form-group">
								<label for="username">用户名</label>
								<div class="input-wrapper">
									<div class="input-icon">👤</div>
									<input type="text" id="username" name="username" class="form-control"
										placeholder="请输入用户名" required>
								</div>
								<div style="margin-top: 8px;">
									<span id="statusText" class="status-text">请输入用户名</span>
								</div>
							</div>

							<!-- 密码 -->
							<div class="form-group">
								<label for="password">密码</label>
								<div class="input-wrapper">
									<div class="input-icon">🔒</div>
									<input type="password" id="passwords" name="password" class="form-control"
										placeholder="请输入密码" required>
									<div class="password-toggle" id="togglePasswords">👁️</div>
								</div>
								<div style="margin-top: 8px;">
									<span id="passwordText" class="status-text">请输入密码</span>
								</div>
							</div>

							<!-- 性别 -->
							<div class="form-group">
								<label for="gender">性别</label>
								<div class="input-wrapper">
									<div class="input-icon">👫</div>
									<select id="gender" name="gender" class="form-control" required>
										<option value="空">请选择性别</option>
										<option value="男">男</option>
										<option value="女">女</option>
									</select>
								</div>
								<div style="margin-top: 8px;">
									<span id="genText" class="status-text"></span>
								</div>
							</div>

							<!-- 生日 -->
							<div class="form-group">
								<label for="birthday">生日</label>
								<div class="input-wrapper">
									<div class="input-icon">📅</div>
									<input type="date" id="birthday" name="birthday" class="form-control" required>
								</div>
							</div>

							<!-- 上传头像 -->
							<div class="form-group">
								<label for="headImg">上传头像</label>
								<input type="file" id="headImg" name="headImg" accept="image/*" style="display: none;">
								<button type="button" id="uploadBtn" class="upload-btn">选择图片</button>
							</div>

							<!-- 注册按钮 -->
							<button class="register-btn" id="registerBtn">
								<span id="registerBtnText">注册</span>
							</button>
						</form>

					</div>
				</div>

			</div>
		</div>
		<!-- 导航栏 -->
		<div class="container-fluid fixed-top  navbar-custom" id="top">
			<nav class="navbar navbar-expand-lg" role="navigation">

				<div class="container">
					<a href="index.jsp" class="navbar-brand navbar-b-custom font-logo">
						<img src="img/headLogo.png" alt="" id="headImage">
					</a>
					<!-- 搜索条 -->
					<form action="searchGoodsDo" method="get">
						<div class="d-flex position-absolute start-50 translate-middle-x serchBar">
							<input name="searchName" type="text" class="form-control form-control-sm" id="searchBar" />
							<button class="btn btn-primary ms-2 serchBut" id="searchBtn">搜索</button>
						</div>
					</form>
					<!-- 右侧用户信息栏 -->
					<ul class="navbar-nav mb-2 mb-lg-0 align-items-center">
						<c:choose>
        				<c:when test="${not empty sessionScope.logInUser}">
            				<ul class="navbar-nav mb-2 mb-lg-0 align-items-center">
								<li class="nav-item d-flex align-items-center">
									<img src="${logInUser.headimg}" alt="" class="headimg align-self-center">
								</li>
								<li class="nav-item"><a href="mineInformation.jsp" class="nav-link navbar-a-custom" id="">个人主页</a></li>
								<li class="nav-item"><a href="ProductOrder.jsp" class="nav-link navbar-a-custom">我的订单</a></li>
							</ul>
        				</c:when>
        				<c:otherwise>
            				<ul class="navbar-nav mb-2 mb-lg-0 align-items-center">
								<li class="nav-item"><a href="#" class="nav-link navbar-a-custom" id="sign">注册</a></li>
								<li class="nav-item"><a href="#" class="nav-link navbar-a-custom" id="login">登录</a></li>
							</ul>
        				</c:otherwise>
    				</c:choose>
					</ul>
				</div>
			</nav>
		</div>
		<!-- 中部信息区 -->
		<div class="container-fluid" id="middle">
			<div class="container middle">
				<div id="seller-info">
					<a href="sellerInfo"><img src="${user.headimg }" class=""></a>
					<div class="seller-name">
						<p><a href="sellerInfo">${user.username}</a></p>
					</div>
					<div class="seller-otherInfo">
						<a href="sellerInfo" class="text-center">${user.address}</a>
						<c:choose>
    						<c:when test="${signDate[0] != 0}">
       							<a href="sellerInfo" class="text-center">入驻${signDate[0]}年</a>
    						</c:when>
    						<c:when test="${signDate[1] != 0}">
        						<a href="sellerInfo" class="text-center">入驻${signDate[1]}月</a>
    						</c:when>
    						<c:otherwise>
        						<a href="sellerInfo" class="text-center">入驻${signDate[2]}天</a>
    						</c:otherwise>
						</c:choose>
						<a href="sellerInfo" class="text-center">卖出${user.soldCount}件</a>
						<a href="sellerInfo" class="text-center">好评率${rate}%</a>
					</div>
				</div>
				<div class="goods-info">
					<div class="info-img">
						<img src="${good.goodimg}" alt="">
					</div>
					<div class="info-text">
						<strong class="price">￥${good.goodprice}</strong><small class="efp">  包邮</small>
						<div class="title">
							<p>${good.goodname}</p>
						</div>
						<div class="dec">
							<p>${good.gooddec}</p>
						</div>
						<div class="otherInfo">
							<p><strong>品牌</strong><br/><small>${good.brand}</small></p>
							<p><strong>成色</strong><br/><small>${good.goodstat}</small></p>
							<p><strong>推荐交易方式</strong><br/><small>${good.goodTradetType}</small></p>
						</div>
						<div class="but">
							<div class="d-flex">
								<a href="buyGoods" class="leftBut text-center"><i class="fa fa-shopping-bag"></i>  立即购买</a>
								<a href="chartingRecords.jsp" class="rightBut text-center"><i class="fa fa-comments"></i>  联系店家</a>
								<form action="addCollDo" style="margin:0; width:100%;" method="post">
									<input type="hidden" name="goodid" value="${good.goodid}">
									<input type="hidden" name="userid" value="${user.userid}">
									<c:choose>
        								<c:when test="${collC == false}">
        									<input type="hidden" name="add" value="true">
            								<a href="#" class="likeBut text-center" onclick="$(this).parent().submit();"><i class="fa fa-star"></i>  收藏</a>
        								</c:when>
        								<c:otherwise>
        									<input type="hidden" name="del" value="true">
        									<a href="#" class="likeBut text-center" onclick="$(this).parent().submit();"><i class="fa fa-star"></i>  取消收藏</a>
        								</c:otherwise>
    								</c:choose>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
			
		<!-- 底部区 -->
		<footer class="container-fluid bottom p-3 mt-auto" id="footer">
			<div class="font-logo infoLeft mx-auto">
				<strong>复焕集 </strong>旧物也能焕然一新的二手市场。
			</div>
			<div class="container">
				<div class="d-flex flex-wrap justify-content-between">
					<ul class="footer-links mb-2 mb-lg-0 flex-grow-1 px-3 text-center">
						<strong>关于我们</strong>
						<li><a href="">公司介绍</a></li>
						<li><a href="">团队介绍</a></li>
						<li><a href="">媒体报道</a></li>
						<li><a href="">加入我们</a></li>
					</ul>
					<ul class="footer-links mb-2 mb-lg-0 flex-grow-1 px-3 text-center">
						<strong>帮助中心</strong>
						<li><a href="">新手入门</a></li>
						<li><a href="">交易流程</a></li>
						<li><a href="">常见问题</a></li>
						<li><a href="">安全指南</a></li>
					</ul>
					<ul class="footer-links mb-2 mb-lg-0 flex-grow-1 px-3 text-center">
						<strong>规则中心</strong>
						<li><a href="">用户协议</a></li>
						<li><a href="">隐私政策</a></li>
						<li><a href="">交易规则</a></li>
						<li><a href="">社区公约</a></li>
					</ul>
					<ul class="footer-links mb-2 mb-lg-0 flex-grow-1 px-3 text-center">
						<strong>联系我们</strong>
						<li><a href="">客服电话：400-114-514</a></li>
						<li><a href="">商务合作：bd@fuhuanji.com</a></li>
						<li><a href="">举报反馈：report@fuhuanji.com</a></li>
					</ul>
				</div>
			</div>
		</footer>
	</body>
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<script src="js/jquery.js"></script>
	<script src="js/sign.js"></script>
	<script src="js/login.js"></script>
	<script>
	</script>
</html>